🎖️GitЯра🎖️
Commit 80d2ad2046d8e7bbd1cf8f11b6bd728ef9a29ff0
Parents : b38b918
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-08-13T15:49:02Z
Committer : GitHub <noreply@github.com>
Date : 2026-08-13T15:49:02Z
test(settings): fix flaky installProfile snackbar test (#6675)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Changes
1 files changed, 6 insertions(+), 1 deletions(-)
Diff
diff --git a/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/radio/RadioConfigViewModelTest.kt b/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/radio/RadioConfigViewModelTest.kt
index 9399f4486f..4688a53dc9 100644
--- a/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/radio/RadioConfigViewModelTest.kt
+++ b/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/radio/RadioConfigViewModelTest.kt
@@ -28,6 +28,7 @@ import dev.mokkery.mock
import dev.mokkery.verify
import dev.mokkery.verify.VerifyMode.Companion.exactly
import dev.mokkery.verifySuspend
+import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -1037,9 +1038,13 @@ class RadioConfigViewModelTest {
{
throw MalformedMeshtasticUrlException("bad profile")
}
+ // UiText.resolve() loads the string on real Dispatchers.Default, outside the test scheduler,
+ // so await the snackbar call instead of draining with runCurrent().
+ val snackbarShown = CompletableDeferred<Unit>()
+ every { snackbarManager.showSnackbar(any(), any(), any(), any(), any()) } calls { snackbarShown.complete(Unit) }
viewModel.installProfile(profile)
- runCurrent()
+ snackbarShown.await()
verify { snackbarManager.showSnackbar(message = "This Channel URL is invalid and can not be used") }
}
Served by rngit 1.5.4 - Generated in 0.04s